#pragma once

#include <QtGui/QWidget.h>
#include <QtCore/QTimer.h>

#include "WaveForm.h"
#include "SampleWindow.h"

class QWaveFormView : public QWidget, ISampleWindowListener
{ 
	Q_OBJECT

public:
	QWaveFormView( QWidget* _parent );

	void					SetWaveFormWindow( SampleWindow* waveFormWindow );

protected:
	virtual void 			mousePressEvent( QMouseEvent* mouseEvent );
	virtual void 			mouseReleaseEvent( QMouseEvent* mouseEvent );
	virtual void 			mouseMoveEvent( QMouseEvent* mouseEvent );
	virtual void 			wheelEvent(QWheelEvent* wheelEvent);

private:
	virtual void			sampleWindowChanged( SampleWindow* sampleWindow );
	
	QString					mDebugText;
	SampleWindow*			mWaveFormWindow;
	bool					mDragging;
	SampleWindow			mPreDragSampleWindow;
	
	virtual void			paintEvent(QPaintEvent* _paintEvent);
};
